home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / bugs < prev    next >
Text File  |  1994-01-15  |  13KB  |  266 lines

  1. This text files describes some bugs in the MiNT library, as well as some
  2. ways in which the library's behaviour differes from most UNIX systems.  If
  3. the document looks like I'm talking to myself in places, it's because it was
  4. originally compiled by boender@dutiws.TWI.TUDelft.NL (Hildo Biersma), and
  5. I've marked it up to use as a sort of checklist of things to fix.  Since
  6. some of these problems will be resolved in later releases of the library,
  7. try not to depend too heavily on the behavior described here.
  8.  
  9. entropy@terminator.rs.itd.umich.edu (Nick Castellano)
  10.  
  11. --------------------------------------------------------------------------
  12.  
  13. *.c: ++boender
  14.   Currently, the code for the mintlibs does various checks
  15.   according to the various versions of MiNT. Now, this is all very
  16.   well, but in some cases, this causes *three* versions of the
  17.   code to exist: TOS, old MiNT and new MiNT. Should this be cleaned
  18.   up at some time, i.e. do we stop supporting MiNT before 0.8 or 0.9?
  19.   Some obvious candidates are killpg.c and unx2dos.c.
  20.  
  21. *.h:  ++boender
  22.   I have a problem using gcc and GNU programs. If a Makefile from a
  23.   GNU program sets a gcc parameter of -I../lib, and a C file does
  24.   #include "wait.h", "../lib/wait.h" will be included. Now this file
  25.   includes <sys/wait.h>, which does an #include <wait.h>. This, in turn,
  26.   includes the GNU lib/wait.h! (Wow, recursive, recursive, .....)
  27.   
  28.   This could be solved in various ways. I make a symbolic link to
  29.   <sys/wait.h> from <wait.h>. <sys/wait.h> could do a #include "../wait.h".
  30.   The parameter -I/usr/include could be added in the GNU Makefile.
  31.   For you to decide upon the correct action!
  32.  
  33.   [I just read this for the 90th time and I finally understand what's being
  34.   said (I can be pretty dense sometimes. <grin>) I've hopefully made it
  35.   impossible for this to go into an infinite loop by changing the include
  36.   protection in some of the sys/*.h files.  Now it should just unwind the
  37.   second time it hits the sys/wait.h file (or other sys/ file) and
  38.   eventually your compile will bomb because it never got the correct
  39.   definitions from the include file.  That should be easier to track down
  40.   than a hung compiler, at least. -entropy]
  41.  
  42. abort.c: ++entropy
  43.   If my understanding is correct, abort() should unmask SIGABRT, and also
  44.   set SIGABRT's signal handler to SIG_DFL if it was SIG_IGN, before raising
  45.   the signal.  Would someone with a copy of the POSIX spec please look into
  46.   this?
  47.  
  48. access.c: ++entropy
  49.   I think my "superuser can access anything" assumption is wrong, especially
  50.   if checking execute permissions.
  51.  
  52. alarm.c: ++entropy
  53.   alarm() will silently "round down" any requested time greater than
  54.   LONG_MAX / 1000 (approximately 2 million seconds).  Most UNIXes allow much
  55.   larger maximum values (usually LONG_MAX).  MiNT needs this extremely small
  56.   maximum value because wakeup scheduling is calculated in milliseconds by
  57.   the kernel.  This cannot be fixed without changing MiNT.  alarm() does not
  58.   work at all under TOS.
  59.  
  60. clock.c: ++boender, ++entropy
  61.   clock() is currently implemented as an alias for _clock(), which makes it
  62.   hopelessly different from the UNIX version, since it returns time elapsed
  63.   since the program started, and not the CPU time used by the process and
  64.   its children that have terminated so far.  Also, the time units used are
  65.   different (200 Hz ticks instead of microseconds).  When clock() is fixed,
  66.   CLOCKS_PER_SEC in time.h will need to be changed, as ANSI specifies that
  67.   clock()/CLOCKS_PER_SEC gives the CPU time used, in seconds, since the
  68.   beginning of execution.  It may be a good idea to change CLK_TCK to agree,
  69.   or maybe CLK_TCK should be used for the actual 200 Hz hardware tick, and
  70.   change only CLOCKS_PER_SEC.  CLK_TCK is used in times.c.  CLOCKS_PER_SEC
  71.   is used in sleep.c.
  72.  
  73. crtinit.c: ++nox
  74.   Some programs like uuxqt (taylors at least) understand exit code
  75.   EX_TEMPFAIL (75) to mean retry the command (uux job) later.  Now when
  76.   _crtinit can't initialize it does Pterm(-1) and uuxqt thinks the job can't
  77.   be retried, although it probably can...  so would it make sense to use
  78.   Pterm(EX_TEMPFAIL) instead?  Or maybe make this exit code compile-time
  79.   configurable like __default_mode__...
  80.  
  81. getopt.c, unistd.h: ++boender
  82.   The three externally usable variables defined in getopt.c should be
  83.   included in <unistd.h>, where getopt() is declared too.  These
  84.   are: 'extern char *optarg', 'extern int opterr' and 'extern int optind'.
  85.   [Not really a bug.  Leave it this way because UNIX doesn't have these
  86.   vars in any headers either. -entropy]
  87.  
  88. getrusag.c, wait3.c, resource.h: ++entropy
  89.   Most of the struct rusage members are fake.
  90.   
  91. ioctl.c: ++nox
  92.   TIOCSETP is #defined to be == TIOCSETN, but they are not really...
  93.   also still looks like it disables RTSCTS every time, unless i
  94.   specifically set that bit (0x2000), and thats not #defined in ioctl.h.
  95.   (and more things like TIOCFLUSH... but Eric knows them already. :-)
  96.  
  97. kill.c: ++boender, ++entropy 
  98.   On UNIX (SysV), system processes (PID 0 and 1) are treated specially.
  99.   This is somewhat different under MiNT, where init(1), if run at all, need
  100.   not have PID 1.  PID 0 is already treated in the correct manner by
  101.   Pkill().  PID 1 really deserves special treatment under MiNT in any case,
  102.   because shooting signals at MiNT's child process (be it init(1), or some
  103.   shell, or whatever) isn't likely to have the expected results.  I'm not
  104.   sure if this can reasonably be resolved in the library alone.
  105.  
  106.   Ultrix defines a system process as any process with a parent PID of 0.
  107.   This definition may be helpful for implementing kill() correctly in the
  108.   library.
  109.  
  110.   The man page for the MiNT call Pkill() forgets to mention that
  111.   either the effective user ID of the caller must be zero (super-user) or
  112.   else the real user IDs must match.  Note that, on UNIX, the caller must
  113.   be super-user or else the real or effective user IDs of both processes
  114.   must match.  This might be a bug in MiNT or the MiNT documentation.
  115.   Ask Eric?
  116.  
  117. limits.h: ++Uwe_Ohse@pb2.maus.de
  118.   CLK_TCK should be defined here and not just in time.h, since SVR4 does.
  119.   [I disagree, limits.h should be strictly ANSI and is already polluted
  120.   as it is -entropy]
  121.  
  122. link.c: ++nox
  123.   link() returns the same error code for different things i.e. EACCESS when
  124.   it really means EEXIST.
  125.  
  126. localtim.c: ++nox
  127.   Fix localtime() etc. to get the start/end DST rules from $TZ...
  128.  
  129. main.c: ++boender
  130.   In exit(), stdin, stdout and stderr are flushed, all other file
  131.   descriptors are closed. I don't know what POSIX says, but System V
  132.   wants stdin, stdout and stderr to be closed too.
  133.  
  134. mkfifo.c: ++entropy
  135.   The mkfifo() function is fake.  It always returns failure.
  136.  
  137. mknod.c: ++entropy
  138.   The current "emulation" of mknod() is really silly, it does nothing at
  139.   all and indicates that an error occurred.  We could at least try to
  140.   emulate properly for the kinds of files we know how to make (directories,
  141.   regular files, etc).
  142.  
  143. mktemp.c: ++entropy
  144.   Produces different sorts of filenames than UNIX does.
  145.  
  146. open.c: ++entropy
  147.   open() returns -4 instead of -1 on errors when __MSHORT__ is defined (but
  148.   only in certain cases).
  149.  
  150. open.c: ++nox
  151.   Should open() do a TIOCSPGRP too when it Fforces the control tty?
  152.   I think, but i'm not 100% sure...
  153.   Currently errno is set to EPATH (ENOTDIR) in some cases where UNIX would
  154.   give EFILNF (ENOENT).  The GEMDOS error codes should be translated by the
  155.   library in these cases.  This affects open() and creat(), and possibly
  156.   other functions as well (check access(),  unlink(), mkdir(), anything that
  157.   accesses files by name).
  158.  
  159. pgrp.c: ++entropy
  160.   The setsid() function never really disassociates the controlling tty from
  161.   the current process, since MiNT doesn't seem to have any such concept.  It
  162.   gets around this with a bunch of kludges in setsid(), ioctl(), and open().
  163.  
  164. popen.c: ++boender
  165.   This function reads the environment variable SHELL to find your shell,
  166.   and takes /bin/sh as an alternative. I think the opposite should be
  167.   done: only take SHELL of /bin/sh does not exist.
  168.   [See my comments on system.c -entropy]
  169.  
  170. read.c, write.c: ++entropy
  171.   When a backgrounded process is reading from or writing to its controlling 
  172.   tty, and its process group has no controlling tty, it should get a return
  173.   value of -1 from the read() or write() with errno set to EIO.  I'm
  174.   not really sure what the controlling tty of a process _group_ is, so
  175.   I'm clueless as to how to try to implement this.
  176.  
  177. scanf.c: ++jrb
  178.   Evidently loses big time.  Run Gcctests and find out what's what.
  179.  
  180. sigactio.c: ++nox@jelal.north.de, ++entropy
  181.   sigblock() could be declared int at least #ifndef __MSHORT__.  The
  182.   functions sigpending(), sigprocmask(), and sigsuspend() have not been
  183.   tested.  The other new POSIX sig*() functions have been tested but not
  184.   exhaustively.
  185.  
  186. sleep.c: ++boender, ++entropy
  187.   sleep() will never sleep for more than LONG_MAX / 1000 (approximately 2
  188.   million) seconds because Talarm() is used in its implementation (see
  189.   alarm.c).  usleep() is of type void.  This may not be correct:  it is of
  190.   type unsigned on UN*X, and should be of type unsigned long in the mintlibs.
  191.  
  192. stat.c: +nox
  193.   In lstat(), maybe make filenames with trailing slash follow symlinks?
  194.   sometimes it would be nice if i could do `ls -l /usr/' and get whats 
  195.   in there, not just the link...
  196.   [This sounds like a bad idea to me.  Sounds like a kludge in ls is
  197.   what's needed here, if anything. -entropy]
  198.  
  199. statfs.c: ++entropy
  200.   Hildo's kludge for /PROC, /PIPE, /SHM will have really unexpected results
  201.   for any signal handler that deals with the current directory, if it is
  202.   called in the small period of time while the current directory is
  203.   changed.  Shouldn't cause major problems.
  204.  
  205. system.c: ++boender
  206.   Currently, this function emulates the UN*X function, including
  207.   simple input/output redirection. It might be wise to check
  208.   if "/bin/sh" exists; if it exists, to call "/bin/sh -c <cmdline>".
  209.   If it does not exist, keep the current behaviour (emulation).
  210.   [I feel better about the way this is currently handled as there are
  211.   too many broken shells out there, and too many problems with figuring
  212.   out what a user means by "/bin" on a tos file system, and so on.  The
  213.   current scheme is more likely to work for more users more of the time...
  214.   -entropy]
  215.   [well you could argue over that now that there are `real' shells
  216.   available at least for MiNT...  but more important, if it `emulates' it
  217.   could do better, like in system ("uux foobox!foo '>bar'") pass the
  218.   quoted '>bar' to uux at least as long as the `emulation' doesn't know
  219.   how to uucp back output of remote commands... :-) -nox@jelal.north.de]
  220.   [OK, if someone wants to write a fix for system() that execs a shell,
  221.   I'll accept it so long as there is a way (via an environment variable)
  222.   for the user to select the emulation as it is currently working.  Fixes
  223.   to make the emulation more robust would also be welcome. -entropy]
  224.  
  225. thread.c: ++nox
  226.   tfork() doesn't know about -mbaserel, had to save a4 (base pointer)
  227.   myself for the child.  (and all this only because we still don't have a
  228.   real vfork...)
  229.  
  230. types.h: ++entropy
  231.   Need ssize_t for POSIX compliance.
  232.  
  233. unlink.c: ++nox@jelal.north.de
  234.   When a file is still open on a GEMDOS filesystem MiNT already sets some
  235.   flag and unlinks after the close, but until then open() still finds the
  236.   file!  (which can be annoying on things like lock files...)
  237.   [I don't think this can be fixed in the library.  MiNT acts this
  238.   way on purpose.  -entropy]
  239.  
  240. utime.c: ++entropy
  241.   The utime() contains a kludge to make it look like the call succeds on a
  242.   directory, even though it really doesn't change the timestamp.
  243.  
  244. utmp.c: ++boender
  245.   The utmp structure as defined differs from the System V structure.
  246.   Now, I don't know what BSD does, but I'll look it up. Do you
  247.   know what POSIX says about the utmp structure?
  248.   Also, the System V getutent, getutid, etc. calls are missing from
  249.   the mintlibs, but they are so dependent on fields in the utmp
  250.   structure that are missing in the mintlibs that they cannot be
  251.   written without changing the utmp structure.
  252.   I think complying with POSIX on this would be a Good Thing; if
  253.   someone could send me the relevant parts, I'll write the routines.
  254.   Note that all kind of stuff is dependent on this and has to be
  255.   emulated in the mintlibs, like getlogin(), or left out altogether,
  256.   like ttyslot().
  257.   Oh, and this: changing the utmp structure is a pretty large
  258.   operation, since init(1) will have to be overhauled completely.
  259.   As I don't think MiNT will ever write /etc/utmp and /etc/wtmp
  260.   structures on booting, perhaps we should leave this be.
  261.  
  262. write.c: ++nox
  263.   On GEMDOS filesystems, don't try to write to a file when some other
  264.   process might have it open, you'll lose data.  And O_APPEND doesn't help.
  265.   Also writes don't update timestamps on GEMDOS filesystems.
  266.